import request from '@/utils/request';
import { baseHost } from '@/utils/request';
let websocketProtocol;
if (document.location.protocol === 'http:') {
  websocketProtocol = 'ws';
} else {
  websocketProtocol = 'wss';
}
// 未读消息查询
export function ddioWebsocket(id) {
  return `${websocketProtocol}://${baseHost}/websocket/${id}`;
}
// 查询消息列表
export function getMessagesList(params) {
  return request({
    url: '/api/system/notices',
    method: 'get',
    params,
  });
}
// 删除消息
export function deleteMessage(params) {
  return request({
    url: `/api/system/notices`,
    method: 'delete',
    data: params,
  });
}
// 标记消息已读
export function signMessageRead(params) {
  return request({
    url: `/api/system/notices/`,
    method: 'post',
    data: params,
  });
}
